import { IsString, MinLength, MaxLength, IsOptional } from 'class-validator';
import mongoose from 'mongoose';

export class CreateTenantDto {
    @IsString()
    @MinLength(2)
    @MaxLength(50)
    name!: string;

    @IsString()
    @MinLength(2)
    @MaxLength(50)
    code!: string;
    @IsOptional()
    @IsString({ message: '创建人必须是字符串' })
    createdBy!: mongoose.Schema.Types.ObjectId;


}
export class UpdateTenantDto {
    @IsString()
    @MinLength(2)
    @MaxLength(50)
    name!: string;

    @IsString()
    @MinLength(2)
    @MaxLength(50)
    code!: string;
    @IsOptional()
    @IsString({ message: '更新人必须是字符串' })
    updatedBy!: mongoose.Schema.Types.ObjectId;

}